﻿// ADF (Automatic Direction Finder) Receiver - 空中定向方位指示计

#include "ADF.h"

void drawADF(double x0, double y0, double r, double angle)
{
    int width = x0 * 2;
    int height = y0 * 2;
    int radius = r;//192
    double circle_x = width / 2;
    double circle_y = height / 2;
    double circle_r = radius;

//    initgraph(width, height, INIT_RENDERMANUAL);//手动渲染
    ege_enable_aa(true);//抗锯齿
//    setbkcolor(WHITE);//背景
//    setfillcolor(EGERGB(102, 102, 102));//矩形颜色
//    ege_fillrect(width / 2 - radius * 1.16667, height / 2 - radius * 1.25, radius * 2.333, radius * 2.5);//矩形
    //填充外圆
    setfillcolor(EGERGB(55, 55, 55));
    ege_fillellipse(width / 2 - radius, height / 2 - radius, 2 * radius, 2 * radius);
    //内圆加痕
    //setcolor(EGEARGB(0xFF, 0x20, 0x20, 0x20));
    setcolor(EGERGB(30, 30, 30));
    setlinewidth(radius * 0.03333);//8
    ege_ellipse(width / 2 - radius, height / 2 - radius, 2 * radius, 2 * radius);

    //中间部分
    //setcolor(EGEARGB(0xFF, 0x33, 0x33, 0x33));
    setcolor(EGERGB(45, 45, 45));
    setlinewidth(radius * 0.12083);//29
    ege_ellipse(width / 2 - radius - radius * 0.04583, height / 2 - radius - radius * 0.04583, 2 * radius + radius * 0.09167, 2 * radius + radius * 0.09167);


    setcolor(EGERGB(20, 20, 20));
    setlinewidth(radius * 0.01666);//4
    ege_ellipse(width / 2 - radius + radius * 0.00833, height / 2 - radius + radius * 0.00833, 2 * radius, 2 * radius);//2  2  2*r   2*r


    setcolor(EGERGB(45, 45, 45));
    setlinewidth(radius * 0.02916);//7
    ege_ellipse(width / 2 - radius + radius * 0.02083, height / 2 - radius + radius * 0.02083, 2 * radius - radius * 0.04166, 2 * radius - radius * 0.04166);//5  5  -10  -10

    setcolor(EGERGB(15, 15, 15));
    setlinewidth(radius * 0.02916);//7
    ege_ellipse(width / 2 - radius + radius * 0.04166, height / 2 - radius + radius * 0.04166, 2 * radius - radius * 0.08333, 2 * radius - radius * 0.0833);//  10  10  -20  -20


    //外圆框
    setcolor(BLACK);
    setlinewidth(radius * 0.025);//6
    ege_ellipse(width / 2 - radius - radius * 0.1167, height / 2 - radius - radius * 0.1167, 2 * radius + radius * 0.1167 * 2, 2 * radius + radius * 0.1167 * 2);
    //记号
    setcolor(BLACK);//描边颜色
    setlinewidth(radius * 0.00625);//线条粗细//
    ege_circle(circle_x, circle_y, circle_r + circle_r / 10);//描边

    ege_point p5 = { circle_x - circle_r - circle_r / 10 + circle_r / 30 * 11 ,circle_y - circle_r - circle_r / 10 + circle_r / 30 * 11 };
    ege_setpattern_ellipsegradient(p5, EGERGB(160, 160, 160), circle_x - circle_r - circle_r / 10, circle_y - circle_r - circle_r / 10, 2 * (circle_r + circle_r / 10), 2 * (circle_r + circle_r / 10), EGEACOLOR(0xFF, 0x00161616));
    ege_fillrect(circle_x - circle_r - circle_r / 10, circle_y - circle_r - circle_r / 10, 2 * (circle_r + circle_r / 10), 2 * (circle_r + circle_r / 10));

    //最外圈


    setcolor(BLACK);//描边颜色
    setlinewidth(radius * 0.01666);//线条粗细//4
    ege_circle(circle_x, circle_y, circle_r + circle_r / 150);//描边

    ege_point p6 = { circle_x - circle_r - circle_r / 300 * 2 + circle_r / 30 * 9 ,circle_y - circle_r - circle_r / 300 * 2 + circle_r / 30 * 9 };
    ege_setpattern_ellipsegradient(p6, EGERGB(140, 140, 140), circle_x - circle_r - circle_r / 300 * 2, circle_y - circle_r - circle_r / 300 * 2, 2 * (circle_r + circle_r / 300 * 2), 2 * (circle_r + circle_r / 300 * 2), EGEACOLOR(0xFF, 0x003A3A3C));
    ege_fillrect(circle_x - circle_r - circle_r / 300 * 2, circle_y - circle_r - circle_r / 300 * 2, 2 * (circle_r + circle_r / 300 * 2), 2 * (circle_r + circle_r / 300 * 2));

    //setfillcolor(EGERGB(80, 80, 80));//填充为灰色
    //ege_fillcircle(circle_x, circle_y, circle_r + circle_r / 300 * 2);//圆形边框
    //第二圈


    setlinewidth(radius * 0.02);//线条粗细
    //setfillcolor(EGERGB(55, 55, 55));//填充为灰色





    ege_point p7 = { circle_x  ,circle_y };
    //ege_setpattern_ellipsegradient(p7, EGERGB(75, 75, 75), circle_x - circle_r + circle_r / 30, circle_y - circle_r + circle_r / 30, 2 * (circle_r - circle_r / 30), 2 * (circle_r - circle_r / 30), EGEACOLOR(0xFF, 0x00292925));
    //ege_fillrect(circle_x - circle_r + circle_r / 30, circle_y - circle_r + circle_r / 30, 2 * (circle_r - circle_r / 30), 2 * (circle_r - circle_r / 30));
    ege_circle(circle_x, circle_y, 0.975 * radius);//描边

    setfillcolor(EGERGB(60, 60, 60));
    //第二圆环
    ege_fillellipse(width / 2 - radius*0.963541, height / 2 - radius*0.963541, radius * 0.963541*2, radius * 0.963541*2);//185
    setfillcolor(EGERGB(50, 50, 50));
    //第一圆环
    ege_fillellipse(width / 2 - radius*0.697916, height / 2 - radius * 0.697916, 2 * radius * 0.697916, 2 * radius * 0.697916);//134


    //ege_fillcircle(circle_x, circle_y, circle_r - circle_r / 30);
    //setfillcolor(EGERGB(38, 38, 38));//填充为深灰色
    //第三圈
    setcolor(EGERGB(150, 150, 150));
    setlinewidth(radius*0.015625);//3
    ege_circle(width / 2, height / 2, 1.1 * radius);


    screwADF(radius, width / 2, height / 2);

    //黄色箭头

    ege_point points1[] = { width / 2 - radius*0.69791 + radius*0.03125,height / 2 - radius*0.026041,//134  6  5
                            width / 2 + radius * 0.69791 - radius*0.15625,height / 2 - radius * 0.026041,// 134  30  5
                            width / 2 + radius*0.69791 - radius * 0.15625,height / 2 - radius*0.052083,// 134  30  10
                            width / 2 + radius*0.69791 - radius * 0.026041,height / 2,     //  134  5  0
                            width / 2 + radius*0.69791 - radius * 0.15625,height / 2 + radius * 0.052083,//  134  30  10
                            width / 2 + radius*0.69791 - radius * 0.15625,height / 2 + radius * 0.026041,//  134  30  5
                            width / 2 - radius*0.69791 + radius*0.03125,height / 2 + radius * 0.026041 };//  134 6 5
    setfillcolor(EGERGB(147, 138, 60));
    ege_fillpoly(7, points1);


    ege_point points2[] = { width / 2 - radius*0.16927,height / 2 - radius*0.026041,//32.5  5
                            width / 2 - radius*0.018229,height / 2 - radius * 0.026041,//3.5  5
                            width / 2 - radius * 0.018229,height / 2 - radius*0.130208,// 3.5  25
                            width / 2 + radius * 0.018229,height / 2 - radius * 0.130208,// 3.5 25
                            width / 2 + radius * 0.018229,height / 2 - radius * 0.026041,// 3.5  5
                            width / 2 + radius * 0.16927,height / 2 - radius * 0.026041,//  32.5  5
                            width / 2 + radius * 0.16927,height / 2 + radius*0.015625,//  32.5  3
                            width / 2 + radius * 0.018229,height / 2 + radius * 0.015625,//  3.5  3
                            width / 2 + radius * 0.018229,height / 2 + radius*0.125,//  3.5  24
                            width / 2 + radius*0.078125,height / 2 + radius * 0.125,//  15  24
                            width / 2 + radius * 0.078125,height / 2 + radius*0.16406,//  15  31.5
                            width / 2 + radius * 0.018229,height / 2 + radius * 0.16406,//  3.5  31.5
                            width / 2 + radius * 0.018229,height / 2 + radius*0.216145,//  3.5  41.5
                            width / 2 - radius * 0.018229,height / 2 + radius * 0.216145,//  3.5  41.5
                            width / 2 - radius * 0.018229,height / 2 + radius * 0.16406,//   3.5  31.5
                            width / 2 - radius * 0.078125,height / 2 + radius * 0.16406,//  15   31.5
                            width / 2 - radius * 0.078125,height / 2 + radius * 0.125,//  15  24
                            width / 2 - radius * 0.018229,height / 2 + radius * 0.125,//  3.5  24
                            width / 2 - radius * 0.018229,height / 2 + radius * 0.015625,//  3.5  3
                            width / 2 - radius * 0.16927,height / 2 + radius * 0.015625 };//  32.5  3

    setfillcolor(EGERGB(140, 97, 58));
    ege_fillpoly(20, points2);


    int i = 0;

    for (i = 0; i <= 360; i += 5)
    {
        double x1;
        double y1;
        double x2;
        double y2;
        double actual_angle = i - angle;
        if (actual_angle < 0) actual_angle += 360;
        setcolor(EGERGB(190, 190, 190));
        LOGFONT f;

        getfont(&f);
        setfont(20, 0, "Arial");
        f.lfHeight = radius * 0.188; // 设置字体高度//45
        f.lfWeight = radius * 41.66666;// 设置字体粗细//8000
        f.lfQuality = PROOF_QUALITY;
        f.lfPitchAndFamily = FF_DECORATIVE;
        f.lfEscapement = -(actual_angle + 90.0) * 10;
        settextjustify(CENTER_TEXT, CENTER_TEXT);
        setbkmode(TRANSPARENT);

        //f.lfOrientation = (actual_angle ) * 10;

        if (i % 90 == 0)
        {
            x1 = width / 2 + radius*0.70833* cos(PI / 180 * actual_angle);//136
            y1 = height / 2 + radius * 0.70833 * sin(PI / 180 * actual_angle);//136
            x2 = width / 2 + (radius * 0.70833 +radius*0.041666) * cos(PI / 180 * actual_angle);//（136+8）
            y2 = height / 2 + (radius * 0.70833 + radius * 0.041666) * sin(PI / 180 * actual_angle);//（136+8）
            setlinewidth(radius*0.0260416);//5
            ege_line(x1, y1, x2, y2);

            setfont(&f);


            if (i == 0)
            {
                //ege_outtextxy(width / 2 + 136 * cos(PI / 180 * actual_angle),
                //height / 2 + 136 * sin(PI / 180 * actual_angle),"E");
            }

            if (i == 90)
            {
                ege_outtextxy(width / 2 + radius*0.927083 * cos(PI / 180 * actual_angle),//178
                              height / 2 + radius * 0.927083 * sin(PI / 180 * actual_angle), "S");//178
            }
            if (i == 180)
            {
                ege_outtextxy(width / 2 + radius*0.91666 * cos(PI / 180 * actual_angle),//176
                              height / 2 + radius * 0.91666 * sin(PI / 180 * actual_angle), "W");//176
            }

            if (i == 270)
            {
                ege_outtextxy(width / 2 + radius * 0.91666 * cos(PI / 180 * actual_angle),//176
                              height / 2 + radius * 0.91666 * sin(PI / 180 * actual_angle), "N");//176
            }

            if (i == 360)
            {
                ege_outtextxy(width / 2 + radius * 0.927083 * cos(PI / 180 * actual_angle),//178
                              height / 2 + radius * 0.927083 * sin(PI / 180 * actual_angle), "E");//178
            }
            // 设置新的字体

        }
        else if (i % 30 == 0) {
            x1 = width / 2 + radius * 0.70833 * cos(PI / 180 * actual_angle);//136
            y1 = height / 2 + radius * 0.70833 * sin(PI / 180 * actual_angle);//136
            x2 = width / 2 + (radius * 0.70833 + radius*0.072916) * cos(PI / 180 * actual_angle);//（136+14）
            y2 = height / 2 + (radius * 0.70833 + radius * 0.072916) * sin(PI / 180 * actual_angle);//（136+14）

            setlinewidth(radius*0.015625);//3
            ege_line(x1, y1, x2, y2);
            setfont(&f);

            if (i == 30)
            {
                ege_outtextxy(width / 2 +radius*0.9479166* cos(PI / 180 * actual_angle),//182
                              height / 2 + radius*0.9479166 * sin(PI / 180 * actual_angle), "12");//182
            }
            if (i == 60)
            {
                ege_outtextxy(width / 2 + radius * 0.9479166 * cos(PI / 180 * actual_angle),//182
                              height / 2 + radius * 0.9479166 * sin(PI / 180 * actual_angle), "15");//182
            }
            if (i == 120)
            {
                ege_outtextxy(width / 2 + radius * 0.9479166 * cos(PI / 180 * actual_angle),//182
                              height / 2 + radius * 0.9479166 * sin(PI / 180 * actual_angle), "21");//182
            }
            if (i == 150)
            {
                ege_outtextxy(width / 2 + radius * 0.9479166 * cos(PI / 180 * actual_angle),//182
                              height / 2 + radius * 0.9479166 * sin(PI / 180 * actual_angle), "24");//182
            }
            if (i == 210)
            {
                ege_outtextxy(width / 2 + radius * 0.9479166 * cos(PI / 180 * actual_angle),//182
                              height / 2 + radius * 0.9479166 * sin(PI / 180 * actual_angle), "30");//182
            }
            if (i == 240)
            {
                ege_outtextxy(width / 2 + radius * 0.9479166 * cos(PI / 180 * actual_angle),//182
                              height / 2 + radius * 0.9479166 * sin(PI / 180 * actual_angle), "33");//182
            }
            if (i == 300)
            {
                ege_outtextxy(width / 2 + radius * 0.9479166 * cos(PI / 180 * actual_angle),//182
                              height / 2 + radius * 0.9479166 * sin(PI / 180 * actual_angle), "3");//182
            }
            if (i == 330)
            {
                ege_outtextxy(width / 2 + radius * 0.9479166 * cos(PI / 180 * actual_angle),//182
                              height / 2 + radius * 0.9479166 * sin(PI / 180 * actual_angle), "6");//182
            }
        }
        else if (i % 10 == 0)
        {
            x1 = width / 2 + radius*0.708333 * cos(PI / 180 * actual_angle);//136
            y1 = height / 2 + radius * 0.708333 * sin(PI / 180 * actual_angle);//136
            x2 = width / 2 + (radius * 0.708333 +radius*0.088541) * cos(PI / 180 * actual_angle);//（136+17）
            y2 = height / 2 + (radius * 0.708333 + radius * 0.088541) * sin(PI / 180 * actual_angle);//(136+17)

            setlinewidth(radius * 0.015625);
            ege_line(x1, y1, x2, y2);
        }
        else if (i % 5 == 0)
        {
            x1 = width / 2 + radius * 0.708333 * cos(PI / 180 * actual_angle);//136
            y1 = height / 2 + radius * 0.708333 * sin(PI / 180 * actual_angle);//136
            x2 = width / 2 + (radius * 0.708333 +radius*0.03125) * cos(PI / 180 * actual_angle);//(136+6)
            y2 = height / 2 + (radius * 0.708333 + radius * 0.03125) * sin(PI / 180 * actual_angle);//(136+6)

            setlinewidth(radius*0.010416);
            ege_line(x1, y1, x2, y2);
        }

    }


    //黄色标

    double x1, x2, y1, y2;
    x1 = width/2;
    y1 = height / 2 - radius*0.755208;//145
    x2 = width / 2;
    y2 = height / 2 - radius*0.963541;//185
    setcolor(EGERGB(140, 98, 55));
    ege_line(x1, y1, x2, y2);

    x1 = width / 2 + radius*0.885416 * cos(PI / 180 * 45);//170
    x2 = width / 2 + radius* 0.963541* cos(PI / 180 * 45);//185
    y1 = height / 2 - radius * 0.885416 * sin(PI / 180 * 45);//170
    y2 = height / 2 - radius * 0.963541 * sin(PI / 180 * 45);//185

    setcolor(EGERGB(140, 98, 55));
    ege_line(x1, y1, x2, y2);


    x1 = width / 2 - radius*0.885416 * cos(PI / 180 * 45);//170
    x2 = width / 2 - radius * 0.9635416 * cos(PI / 180 * 45);//185
    y1 = height / 2 - radius * 0.885416 * sin(PI / 180 * 45);//170
    y2 = height / 2 - radius * 0.9635416 * sin(PI / 180 * 45);//185

    setcolor(EGERGB(140, 98, 55));
    ege_line(x1, y1, x2, y2);

    x1 = width / 2 + radius*0.859375;//165
    y1 = height / 2;
    x2 = width / 2 + radius*0.9635416;//185
    y2 = height / 2;
    ege_line(x1, y1, x2, y2);

    x1 = width / 2 - radius * 0.859375;//165
    y1 = height / 2;
    x2 = width / 2 - radius * 0.9635416;//185
    y2 = height / 2;
    ege_line(x1, y1, x2, y2);


    x1 = width / 2;
    y1 = height / 2 + radius*0.755208;//145
    x2 = width / 2;
    y2 = height / 2 + radius * 0.9635416;//185
    ege_line(x1, y1, x2, y2);


    x1 = width / 2 - radius * 0.885416 * cos(PI / 180 * 45);//170
    x2 = width / 2 - radius * 0.9635416 * cos(PI / 180 * 45);//185
    y1 = height / 2 + radius * 0.885416 * sin(PI / 180 * 45);//170
    y2 = height / 2 + radius * 0.96354165 * sin(PI / 180 * 45);//185
    ege_line(x1, y1, x2, y2);

    x1 = width / 2 + radius * 0.885416 * cos(PI / 180 * 45);//170
    x2 = width / 2 + radius * 0.9635416 * cos(PI / 180 * 45);//185
    y1 = height / 2 + radius * 0.885416 * sin(PI / 180 * 45);//170
    y2 = height / 2 + radius * 0.9635416 * sin(PI / 180 * 45);//185
    ege_line(x1, y1, x2, y2);




    //矩形
    setfillcolor(EGERGB(25, 25, 14));
    ege_fillrect(width / 2 - radius*0.234375, height/2 + radius*0.947916, radius*0.46875, radius*0.09375);//45  182  90  18

    //文字
    settextjustify(CENTER_TEXT, CENTER_TEXT);
    setbkmode(TRANSPARENT);
    setcolor(EGERGB(190, 190, 190));
    setfont(radius * 0.078125, radius * 0.03125, "Arial", 0, 0, 5000, true, 0, 0);// 15 6 
    ege_outtextxy(width / 2, height / 2 + radius*0.9635416, "LAMINAR/NAV");//185

    for ( double j = 0; j < radius * 0.0520833; j = j + 0.5) {
        setfillcolor(EGERGB(35, 35, 35));
        ege_fillcircle(width / 2 - radius*0.83333+j, height / 2 + radius*1.04166-j, radius*0.165);//160  200  27
    }
    //按钮
    setfillcolor(EGERGB(55, 55, 55));
    ege_fillcircle(width / 2 - radius * 0.83333, height / 2 + radius * 1.04166, radius*0.16);//160  200  25
    setcolor(EGERGB(190, 190, 190));
    setlinewidth(radius * 0.0052083333);//1
    ege_circle(width / 2 - radius * 0.83333, height / 2 + radius * 1.04166, radius*0.135);  //  160  200 21
    setfont(radius * 0.1145833, radius * 0.0416666, "Arial", 0, 0, 50000, 0, 0, 0);//22 8
    ege_outtextxy(width / 2 - radius * 0.83333, height / 2 + radius, "HDG");//  160  192

}

void screwADF(double DIAL_RADIUS, double CENTER_X, double CENTER_Y)//螺丝
{
    // 使用float保证计算精度（根据需求可改为double）
    const float DIAL_RADIUS_F = (float)DIAL_RADIUS;
    const float CENTER_X_F = (float)CENTER_X;
    const float CENTER_Y_F = (float)CENTER_Y;

    // 参数化定义（精确到小数点后6位）
    const float SCREW_OFFSET = DIAL_RADIUS_F * 0.055555556f; // 1/18
    const float ELLIPSE_OFFSET_X = -DIAL_RADIUS_F * 0.111111111f; // -1/9
    const float ELLIPSE_OFFSET_Y = -DIAL_RADIUS_F * 0.166666667f; // -1/6
    const float ELLIPSE_SIZE = DIAL_RADIUS_F * 0.277777778f;  // 5/18
    const float RECT_OFFSET_X = DIAL_RADIUS_F * 0.222222222f;  // 2/9
    const float RECT_OFFSET_Y = DIAL_RADIUS_F * 0.333333333f;  // 1/3
    const float RECT_WIDTH = DIAL_RADIUS_F * 0.555555556f;   // 5/9
    const float RECT_HEIGHT = DIAL_RADIUS_F * 0.611111111f;  // 11/18
    const float CROSS_OFFSET1 = DIAL_RADIUS_F * 0.055555556f;  // 1/18
    const float CROSS_OFFSET2 = DIAL_RADIUS_F * 0.027777778f;  // 1/36
    const float LINE_WIDTH = DIAL_RADIUS_F * 0.016666667f;  // 1/60

    ege_enable_aa(TRUE);

    // 绘制函数（使用浮点坐标）
    auto draw_screw = [&](float cx, float cy) {
        // 精确到小数点后6位的渐变参数
        ege_setpattern_ellipsegradient(
                ege_point{ roundf(cx), roundf(cy) }, // 最终转整数
                EGEACOLOR(0xFF, BLACK),
                roundf(cx + ELLIPSE_OFFSET_X),
                roundf(cy + ELLIPSE_OFFSET_Y),
                roundf(ELLIPSE_SIZE),
                roundf(ELLIPSE_SIZE),
                EGEACOLOR(0, WHITE)
        );
        ege_fillrect(
                roundf(cx - RECT_OFFSET_X),
                roundf(cy - RECT_OFFSET_Y),
                roundf(RECT_WIDTH),
                roundf(RECT_HEIGHT)
        );

        // 灰色渐变层（精确尺寸调整）
        const float adjusted_size = ELLIPSE_SIZE - DIAL_RADIUS_F * 0.055555556f; // 替代原-10
        ege_setpattern_ellipsegradient(
                ege_point{
                        roundf(cx - SCREW_OFFSET * 0.5f),
                        roundf(cy - SCREW_OFFSET * 0.5f)
                },
                EGEACOLOR(0xFF, EGERGB(170, 170, 170)),
                roundf(cx + ELLIPSE_OFFSET_X),
                roundf(cy + ELLIPSE_OFFSET_Y),
                roundf(adjusted_size),
                roundf(adjusted_size),
                EGEACOLOR(0xFF, EGERGB(20, 20, 20))
        );
        ege_fillrect(
                roundf(cx - RECT_OFFSET_X),
                roundf(cy - RECT_OFFSET_Y),
                roundf(RECT_WIDTH),
                roundf(RECT_HEIGHT)
        );

        // 十字线（亚像素级精度）
        setcolor(EGERGB(30, 30, 30));
        setlinewidth(roundf(LINE_WIDTH));

        const float cross_y = cy - CROSS_OFFSET2 * 2.0f;
        ege_line(
                roundf(cx - CROSS_OFFSET1), roundf(cross_y),
                roundf(cx + CROSS_OFFSET1), roundf(cross_y)
        );

        const float cross_x = cx;
        const float cross_y_start = cy + CROSS_OFFSET2 / 4;
        const float cross_y_end = cy - CROSS_OFFSET2 * 4.0f;
        ege_line(
                roundf(cross_x), roundf(cross_y_start),
                roundf(cross_x), roundf(cross_y_end)
        );
    };

    // 计算四个螺丝中心坐标（浮点运算）
    const float screw_radius = DIAL_RADIUS_F - SCREW_OFFSET;

    // 左上
    draw_screw(
            CENTER_X_F - screw_radius,
            CENTER_Y_F - DIAL_RADIUS_F
    );

    // 右上
    draw_screw(
            CENTER_X_F + screw_radius,
            CENTER_Y_F - DIAL_RADIUS_F
    );

    // 右下
    draw_screw(
            CENTER_X_F + screw_radius,
            CENTER_Y_F + DIAL_RADIUS_F
    );

    // 左下（新增）
    //draw_screw(
    //CENTER_X_F - screw_radius,
    //CENTER_Y_F + DIAL_RADIUS_F
    //);
}

